<!--
 * @Date: 2021-04-23 13:52:26
 * @LastEditors: 哈皮
 * @LastEditTime: 2021-04-23 14:32:09
 * @FilePath: \day-six\demo1\src\components\textList.vue
-->
<template>
  <div class="textList">
      <dl v-for="item in list" :key="item.id" @click="jump(item)">
          <dt>
              <span v-text="item.author"></span>&emsp;·&emsp;
              <span v-text="item.createtime"></span>&emsp;·&emsp;
              <span v-text="item.type"></span>
          </dt>
          <dd>
              <h4 v-text="item.title"></h4>
          </dd>
      </dl>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
    computed:{
        ...mapState(['list'])
    },
    methods:{
        jump(item){
            this.$router.push({
                path:'/comment',
                query:{
                    authorId:item.id
                }
            })
        }
    },
    created(){
        
    }
}
</script>

<style lang='scss'>
.textList{
    dl{
        width: 100%;
        height: 100%;
        text-align: left;
        padding: 10px 0;
        border-bottom: 1px solid #ccc;
        dt{
            width: 100%;
            line-height: 30px;
            font-size: 14px;
            color: #999;
        }
    }
}
</style>